// 导入需要的config和request
import confing from '../config/config.js';
import request from '../util/request.js';
// 申明请求对象
const teamShiftRequest = {
  // dict请求的基本url
  BASE_URL: confing.CAL_URL + "/teamShift",


  //分类排版日历
  select(callbcak){
    let url = this.BASE_URL + "/select";
    request.get(url, callbcak);
  },
  //删除班组排班
  delete(recordId, callback) {
    // 拼接URL
    let url = this.BASE_URL + "/delete?recordId=" + recordId;
    request.delete(url, callback);
  },
  //查询班组信息
  list(planId, callbcak) {
    // url
    let url = this.BASE_URL + "/list?planId=" + planId;
    request.get(url, callbcak);
  },

  //添加计划数据
  save(theDay, teams, shiftId, planId, shiftType, callback) {
    let url = this.BASE_URL + "/save";
    request.post(url, { "theDay": theDay, "teams": teams, "shiftId": shiftId, "planId": planId, "shiftType": shiftType }, callback);
  },
}
// 将dictRequest暴漏出去
export default teamShiftRequest;